package com.dragon.shop_user.service.impl;

import com.dragon.shop_common.utils.AjaxResult;
import com.dragon.shop_user.domain.param.GetOrderNoParam;
import com.dragon.shop_user.domain.vo.GetOrderNoVo;
import com.dragon.shop_user.feign.OrderFeign;
import com.dragon.shop_user.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private OrderFeign orderFeign;

    @Override
    public AjaxResult<String> getOrderNo() {
        AjaxResult<String> result = orderFeign.getOrderNo();
        return AjaxResult.succeedWith(result.getData());
    }

    @Override
    public AjaxResult<GetOrderNoVo> getOrderNo2(String userId) {
        AjaxResult<GetOrderNoVo> result = orderFeign.getOrderNo2(userId);
        return AjaxResult.succeedWith(result.getData());
    }

    @Override
    public AjaxResult<GetOrderNoVo> getOrderNo3(GetOrderNoParam getOrderNoParam) {
        AjaxResult<GetOrderNoVo> result = orderFeign.getOrderNo3(getOrderNoParam.getUserId());
        return AjaxResult.succeedWith(result.getData());
    }

    @Override
    public AjaxResult<GetOrderNoVo> getOrderNo4(GetOrderNoParam getOrderNoParam) {
        AjaxResult<GetOrderNoVo> result = orderFeign.getOrderNo4(getOrderNoParam);
        return AjaxResult.succeedWith(result.getData());
    }

    @Override
    public AjaxResult<GetOrderNoVo> getOrderNo5(GetOrderNoParam getOrderNoParam) {
        AjaxResult<GetOrderNoVo> result = orderFeign.getOrderNo5(getOrderNoParam);
        return AjaxResult.succeedWith(result.getData());
    }

}
